﻿using System.Globalization;
using Airborne.ScrumPoker.Module.Converters;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Airborne.ScrumPoker.Module.Tests.Converters
{
    [TestClass]
    public class ColourTimerConverterTestFixture
    {

        [TestMethod]
        public void TimerColourRangeTest()
        {
            ColourTimerConverter converter = new ColourTimerConverter();
            
            string value = (string)converter.Convert(120, null, null, CultureInfo.CurrentCulture);
            Assert.AreEqual(ColourTimerConverter.DefaultBlue, value);
            
            value = (string)converter.Convert(35, null, null, CultureInfo.CurrentCulture);
            Assert.AreEqual(ColourTimerConverter.DefaultBlue, value);

            value = (string)converter.Convert(34, null, null, CultureInfo.CurrentCulture);
            Assert.AreEqual(ColourTimerConverter.WarningOrange, value);


            value = (string)converter.Convert(20, null, null, CultureInfo.CurrentCulture);
            Assert.AreEqual(ColourTimerConverter.WarningOrange, value);

            value = (string)converter.Convert(19, null, null, CultureInfo.CurrentCulture);
            Assert.AreEqual(ColourTimerConverter.CriticalRed, value);
            
            value = (string)converter.Convert(0, null, null, CultureInfo.CurrentCulture);
            Assert.AreEqual(ColourTimerConverter.CriticalRed, value);

        }


    }
}
